package svg.action;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;

public abstract class ActionBase extends Action implements ISelectionListener,
		IWorkbenchAction {

	protected final IWorkbenchWindow window;
	
	public ActionBase(IWorkbenchWindow window){
		this.window = window;
		window.getSelectionService().addSelectionListener(this);
	}
	
	@Override
	public void dispose() {
		actionDispose();
	}

	@Override
	public void selectionChanged(IWorkbenchPart arg0, ISelection arg1) {
		actionSelectChanaged(arg0,arg1);
	}

	public abstract void actionDispose();
	
	public abstract void actionSelectChanaged(IWorkbenchPart arg0, ISelection arg1);
}
